package studychinese.view;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.hschinese.pronunciation.R;

import java.util.ArrayList;
import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by zf on 2018/1/4.
 */

public class ColumnView {
    @Bind(R.id.iv_homerank1)
    ImageView ivHomerank1;
    @Bind(R.id.tv_rank_number)
    TextView tvRankNumber;
    @Bind(R.id.tv_rank_current)
    TextView tv_rank_current;
    @Bind(R.id.iv_shape_hoperank1)
    ImageView ivShapeHoperank1;

    private int number;
    private Context context;
    private List<Integer> list=new ArrayList();

    public ColumnView(Context context,int number) {

        this.number=number;
        this.context=context;

    }


    public View innitView() {
        View view = View.inflate(context, R.layout.column, null);
        ButterKnife.bind(this, view);
       if(0==number){
           ivHomerank1.setImageResource(R.mipmap.columnar_0_unclick);

       }else if(1==number){
           ivHomerank1.setImageResource(R.mipmap.columnar_1_unclick);
           tv_rank_current.setText("");
       }else if(2==number){
           ivHomerank1.setImageResource(R.mipmap.columnar_2_unclick);
           tv_rank_current.setText("");
       }else if(3==number){
           ivHomerank1.setImageResource(R.mipmap.columnar_3_unclick);
           tv_rank_current.setText("");
       }else if(4==number){
           ivHomerank1.setImageResource(R.mipmap.columnar_4_unclick);
           tv_rank_current.setText("");
       }else if(5==number){
           ivHomerank1.setImageResource(R.mipmap.columnar_5_unclick);
           tv_rank_current.setText("");
       }else if(6==number){
           ivHomerank1.setImageResource(R.mipmap.columnar_6_unclick);
           tv_rank_current.setText("");
       }
        tvRankNumber.setText(number+"级");
        return view;
    }
    public void setView(int number) {

        if(0==number){
            ivHomerank1.setImageResource(R.mipmap.columnar_0_click);

        }else if(1==number){
            ivHomerank1.setImageResource(R.mipmap.columnar_1_click);

        }else if(2==number){
            ivHomerank1.setImageResource(R.mipmap.columnar_2_click);

        }else if(3==number){
            ivHomerank1.setImageResource(R.mipmap.columnar_3_click);

        }else if(4==number){
            ivHomerank1.setImageResource(R.mipmap.columnar_4_click);

        }else if(5==number){
            ivHomerank1.setImageResource(R.mipmap.columnar_5_click);

        }else if(6==number){
            ivHomerank1.setImageResource(R.mipmap.columnar_6_click);

        }


    }
}
